import Vue from 'vue'
import VueRouter from 'vue-router'
import UI_Router from '../views/UI_Router.vue'
import Contacts from '../views/Contacts.vue'
import About from '../views/About.vue'
import All_Contacts from '../views/2/All_Contacts'
import Alice from '../views/2/Alice'
import Bob from '../views/2/Bob'
import Blog from '../views/2/3/Blog'
import Fax from '../views/2/3/Fax'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'ui_router',
    redirect: '/UI_Router'
  },
  {
    path: '/UI_Router',
    name: 'ui_router',
    component: UI_Router
  },
  {
    path: '/Contacts',
    name: 'contacts',
    component: Contacts,
    redirect: '/Contacts/All_Contacts',
    children: [
      {
        path: 'All_Contacts',
        name: 'all_contacts',
        component: All_Contacts,
      },
      {
        path: 'Alice',
        name: 'alice',
        component: Alice,
      },
      {
        path: 'Bob',
        name: 'bob',
        component: Bob,
        children: [
          {
            path: 'Blog',
            name: 'blog',
            component: Blog,
          },
          {
            path: 'Fax',
            name: 'fax',
            component: Fax,
          },
        ]
      }
    ]
  },
  {
    path: '/About',
    name: 'about',
    component: About
  },

]

const router = new VueRouter({
  routes
})

export default router
